<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: red;
            display: none;
        }
    </style>
</head>

<body>
    <input type="text" id="ipt" value="默认值">

       <div class="box">

       </div>
   

    <script>
        let ipt = document.querySelector('#ipt')
        var ipt1 = {}
        console.log(ipt, 'ipt');
        Object.defineProperty(ipt1, 'value', {
            set: function (newval) {
                ipt.value = newval
                document.querySelector('.box').style.display='block'
                // console.log(ipt.value, 'ipt');
                // console.log('input值改变了', newval, ipt);
            },
        })
        
// 模拟请求，改变input 里面的数据
        setTimeout(()=>{
            ipt1.value='修改了的值'
        },2000)
    </script>
</body>

</html>